1. Field of the Invention
The present invention relates to a controller for controlling a machine such as a general machine tool, a laser beam machine or a plasma machine in which respective axes are driven by servomotors, and more specifically to a technique for improving machining accuracy and machining speed of the machine controlled by the controller.
2. Description of the Related Art
In a machine tool, a laser beam machine or a plasma machine, a machining tool of various kinds (for example, a cutting tool, a drilling tool, a laser beam nozzle or a plasma torch) is attached to a machining head and respective axes for moving the machining head or a working table which moves relatively to the machining head are driven by servomotors.
The servomotor for each axis is controlled by a servo control section (including a servo CPU and a servo amplifier) provided for each axis. Each servo control section controls the servomotor based on a motion command outputted for each axis from the controller of the machine, and a position and speed feedback signals from a pulse encoder provided for each servomotor or axis.
The controller reads a program in which a motion path of the machining tool is specified, and performs an interpolation calculation to determine a plurality of interpolation points along the motion path by software processing. With respect to the interpolation calculation, there is known a method in which interpolation calculation is divided into two stages. The two stages are respectively called a primary interpolation and a secondary interpolation. In the primary interpolation, interpolation points are defined on the motion path in a predetermined sampling period (first sampling period). The secondary interpolation further interpolates the interpolation points defined by the primary interpolation. According to the conventional method, the secondary interpolation is performed on a straight line connecting the interpolation points defined by the primary interpolation.
In FIG. 1, interpolation points obtained by the secondary interpolation according to the conventional method are exemplified in a case where the primary interpolation is a circular interpolation (a motion path A designated by a program is circular). In FIG. 1, points P0, P1, P2 and P3 represent interpolation points determined by the primary interpolation. Those interpolation points are determined along the circular motion path. In the conventional method of the secondary interpolation to be performed subsequently to the primary interpolation, a linear interpolation is performed in the sections P0P1, P1P2 and P2P3 defined by the interpolation points P0, P1, P2, P3 obtained as the outputs of the primary interpolation. Points Q1 to Q23 represent interpolation points outputted in the secondary interpolation according to the conventional method.
As is understood from the example of FIG. 1, when the secondary interpolation is performed as linear interpolation, speed of each axis changes abruptly in the vicinity of the interpolation points P0, P1, P2, P3 defined by the primary interpolation. Since the speed does not change smoothly, a problem such as deterioration in surface roughness of a machined surface arises in an actual machining.
Further, since the secondary interpolation is performed based on speed data derived from the output of the primary interpolation, speed changes abruptly at the time of starting and stopping of the motion or passing a point where a feed rate changes. FIG. 2 is a diagram for explaining the above, in which an example of feed rate of a Y axis is shown in the case where a motion command for each of X, Y and Z axes is outputted based on the output of the secondary interpolation in the conventional method. The direction of the Y axis corresponds to the direction of Y axis of a coordinate system shown in FIG. 1 (the Z axis is perpendicular to a plane of the sheet of FIG. 1.)
In FIG. 2, the feed rate in sections Q0Q1, Q1Q2, Q2Q3, . . . , Q21Q22, Q22Q23 is shown as a bar graph divided into twenty three value areas. In the example of FIG. 1, since a sequence of points outputted by the secondary interpolation aligns on three straight-line sections connected to form a polygonal line, the feed rate in the Y-axis direction changes abruptly in the vicinity of the points P0, P1, P2 and P3. When speed in a section Qi-1Qi (i=1, 2, 3, . . . , 23) is represented by Qi, the feed rate abruptly changes 0xe2x86x92q1 at the time starting of motion from P0; q7xe2x86x92q8 and q8xe2x86x92q9 before and after passing the point P1; q15xe2x86x92q16 and q16xe2x86x92q17 before and after passing the point P2; and P23xe2x86x920 at the time of stopping.
When left as it is, the feed rate of each axis does not change smoothly. Therefore, acceleration/deceleration processing is generally performed on speed data for each axis after the secondary interpolation in order to ensure that the feed rate changes smoothly. However, when each axis is controlled by the acceleration/deceleration processing on the speed data, a path error is produced such that the resulting path for the machining tool deviates inwards from the commanded path. In the example shown in FIGS. 1 and 2, the resulting path will be a path B as shown in FIG. 3 with respect to the motion path A specified by the program.
The above described problems (abrupt change of the feed rate and a path error by the acceleration/deceleration control) are conspicuous especially when the machining speed is high. Therefore, in the controller which performs the two-stage interpolation in conventional method, these problems hinder not only improvement of machining accuracy but also increase of machining speed.
An object of the present invention is to solve the above problems in a controller (having a function of a numerical control) for controlling a machine tool of each kind, a laser beam machine, a plasma machine or the like, so as to contribute improvement of machining accuracy and increase of machining speed of the machine controlled by the controller.
In the present invention, the secondary interpolation is not performed to form a straight line but performed to form a smooth curve in the two-stage interpolation of the primary and secondary interpolations by software processing means included in the controller. Further, in the secondary interpolation processing, acceleration/deceleration control of speed in the tangential direction is performed to thereby restrain a path error and to effect smooth change of speed.
Specifically, according to the present invention, since the secondary interpolation of the two-stage interpolation is not performed on a straight line but performed on a smooth curve, change of speed on each axis is smooth. Further, since the acceleration/deceleration control is performed so that speed in the tangential direction changes smoothly, change of speed is smooth even at the time of starting and stopping of the motion or passing a point where feed rate changes.
In a preferred embodiment of the invention, a command analyzing section, a primary interpolation section, a secondary interpolation section, an intermediate memory and an acceleration/deceleration control section are provided in the controller.
The command analyzing section analyzes a program and converts the program to data for the primary interpolation section. The first interpolating section performs interpolation calculation in each first sampling period to obtain an interpolation point on a commanded path, and outputs the obtained interpolation point to the intermediate memory. The acceleration/deceleration control section performs acceleration/deceleration control based on the data stored in the intermediate memory, and calculates speed in each second sampling period. The secondary interpolation section defines a smooth curve based on output from the acceleration/deceleration control section and the data derived from the intermediate memory, and outputs an interpolation point on the smooth curve in each second sampling period.